<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ page import="java.sql.*"%>
<%@ page import="java.io.*"%>
<%@ page import="java.util.*"%>
<%@page import="servlet.ProcessesDropDown"%>
<%@page import="Logic.Authorizer"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<jsp:include page="t_header.jsp" />
<!--  <div class="breadcrumbs_container">
	<article class="breadcrumbs"> <a href="Proc_Process.jsp">Process</a>
	<div class="breadcrumb_divider"></div>
	<a class="current">Search Procedures & Forms</a> </article>
</div> -->
<jsp:include page="header.html" />

<!-- Declare sidebar -->
<jsp:include page="t_sidebarProcess.jsp" />

<!-- Main Content -->

<section id="main" class="column"> 
<article class="module width_3_quarter">
		<form id="SearchProcess" action="Proc_SearchResult.jsp" method="post">
			<header>
				<h3>Search Procedures & Forms</h3>
			</header>
			<div class="module_content">
				<fieldset id="ByPName"
					style="width: 48%; float: left; margin-right: 3%;">
					<label>By Process Name </label> <select id="PN" name="PN" style="width:80%">
						<%
							ProcessesDropDown PDD = new ProcessesDropDown(out);
							PDD.doGet(request, response);
						%>
					</select>
				</fieldset>

				<fieldset  id="ByName" style="width: 48%; float: left;">
					<label>By Keyword  </label>
					<input type='text'0 id="Name" name="Name" style="width: 80%"> 
				</fieldset>
				<div class="clear"></div>
			</div>
			<footer>
				<div class="submit_link">
					<input id="SearchP" type="submit" name="SearchP" value="Search Procedures" onclick="return SearchFunc('Procedure')" class="alt_btn" >
					<input id="SearchF" type="submit" name="SearchF" value="Search Forms" onclick="return SearchFunc('Form')" class="alt_btn" >
				</div>
			</footer>
		</form>
	</article>
	<script type="text/javascript">
	function limitCheckboxName()
	{
		if(document.getElementById("PNCheck").checked==true)
		{
			document.getElementById("PNCheck").checked=false;
		}
	}
	function limitCheckboxPN()
	{
		if(document.getElementById("NameCheck").checked==true)
		{
			document.getElementById("NameCheck").checked=false;
		}
	}
	function SearchFunc(e)
	{
		var form=document.getElementById("SearchProcess");

		var key1 = "";
		var key2 = "";
		var executable = false;

		if($('#Name').val() != ""){
			key1 = document.getElementById("Name").value;
			executable = true;
		} 
		if ($('#PN').val() != ""){
			if ($('#PN').val() != "All"){
				key2 = document.getElementById("PN").value;
			}
			executable = true;
		} 

		if (executable){
			form.action="Proc_SearchResult.jsp?Keyw="+key1 + "&Keyw2=" + key2 +"&SearchT="+e;
		}
		else
		{
			alert("Please make a selection before proceeding! ");
			return false;
		}

	}
	</script>
</section>
<div class="spacer"></div>

<!-- Declare closing tags -->
<jsp:include page="t_footer.jsp" />